var TestClient = function() {
  
  var url = "./json/";
  
  return {
    Initialise: function() {
      // Add an event handler to all buttons
      
      var allButtons = $(":button");
      
      $.each(allButtons, function(i, n) {
        var buttonID = $(n).attr("id");
        $(n).bind("click", function(e) {
          TestClient.ProcessClick(buttonID);
         });
      });
    },
    
    ProcessClick: function(buttonID) {
      switch(buttonID) {
        case "GetCustomer":
          TestClient.GetCustomer();
          break;
      }
    }
    
    GetCustomers: function() {
      var requestURL = url + "Service/GetCustomer";
      $.getJSON(requestURL, function(json) {
        // display the customer info
        $("<div>").text("FirstName: " + json.FirstName + ", LastName: " + json.LastName).appendTo($("#GetCustomer"));
      }
      DisplayManager.ShowJSON(requestURL);
    }
  }
}();
$(function() {
  TestClient.Initialise();
});
